import browser from './browser';
import { setEnv } from './env';
import { sdkInit } from './wxsdk';


// 安卓键盘导致高度问题丢失，导致浮动脱离文档流的元素错位
const androidKeyboardPatch = () => {
    if (browser.android) {
        window.onload = () => {
            const height = document.body.clientHeight;
            console.log(height, 'oldbody');
            window.addEventListener('resize', () => {
                document.body.style.setProperty('height', `${height}px`);
                console.log(document.body.clientHeight, 'body');
            });
        };
    }
}


export default (): void => {
    setEnv();
    sdkInit();
    androidKeyboardPatch();
}

